package cn.wit.db.entity;

/**
 * 异步请求的通用响应
 * 
 * @author hchaojie
 *
 */
public class AjaxResult {
	public static Integer SUCCESS_CODE = 200;
	public static String SUCCESS_MESSAGE = "success";

	private Integer code;
	private String message;
	
	private Object data;
	
	public AjaxResult() {
		this.code = SUCCESS_CODE;
		this.message = SUCCESS_MESSAGE;
	}

	public AjaxResult(Integer code, String message) {
		this.code = code;
		this.message = message;
	}
	
	/**
	 * 返回一个成功的响应
	 */
	public static AjaxResult success() {
		return new AjaxResult();
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
}
